//
//  TypeOfClass.m
//  mUBB
//
//  Created by Cosmin Stirbu on 1/17/13.
//  Copyright (c) 2013 Cosmin Stirbu. All rights reserved.
//

#import "TypeOfClass.h"
#import "Constants.h"

@implementation TypeOfClass

@synthesize name, typeOfClassId;

- (BOOL)isEqual:(id)object {
    if ([object isKindOfClass:[TypeOfClass class]]) {
        TypeOfClass *otherClass = (TypeOfClass *)object;
        return otherClass.typeOfClassId == self.typeOfClassId;
    }
    return NO;
}

- (id)copyWithZone:(NSZone *)zone {
    TypeOfClass *copy = [[[self class] allocWithZone:zone] init];
    
    if (copy) {
        copy->name = [self.name copyWithZone:zone];
        copy->typeOfClassId = self.typeOfClassId;
    }
    
    return copy;
}

- (NSUInteger)hash {
    return [name hash];
}

- (BOOL)isOtherType {
    return (self.typeOfClassId != TypeOfClass_Course && self.typeOfClassId != TypeOfClass_Laboratory && self.typeOfClassId != TypeOfClass_Seminar);
}
@end
